<!DOCTYPE html>
<html>
<head>
	<div th:replace="common/common_resource :: common_css"></div>
	<title th:text="${application.shop_name} +' | 菜单维护'"></title>
</head>
<body class="hold-transition skin-blue sidebar-mini" >
	<div class="wrapper">
		<div th:replace="common/common_h5 :: loginAndLogout"></div>
		<div th:replace="common/common_h5 :: upload_image"></div>
		<div th:replace="common/common_h5 :: left_menu"></div>
		<div class="content-wrapper">
			<section class="content">
				<div class="row">
					<div class="col-xs-12">
						<div class="box">
							<div class="box-header">
								<div class="row">
									<div class="col-xs-4">
										<span>
											<button type="button" id="add_dep" name="cleanAll" class="btn  btn-warning " style="margin-bottom: 10px;" data-toggle="modal" data-target="#menu_add_and_update">
												<i class="fa fa-plus">添加菜单</i>
											</button></span>
											<div class="modal fade " id="menu_add_and_update" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
											<div class="modal-dialog ">
												<div class="modal-content">
													<div class="modal-header bg-blue">
														<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
														<h4 class="modal-title" id="myModalLabel">添加/修改菜单(<font color="red">&nbsp;&nbsp;*</font>为必填项)</h4>
													</div>
													<div class="modal-body">
															<form  id="formMenu" th:action="${#httpServletRequest.getContextPath()}+'/menu/insertAndUpdate'" method="post">
																<input type="hidden" name="menUuid" th:value="${menUuid!=null}?${menUuid}:'750'">
																<div class="form-group">
																	<label for="emp_degree">所属父菜单<font color="red">&nbsp;&nbsp;*</font></label>
																	<select class="form-control" name="menuPuuid" id="menuPuuid1">
																		<option value="1">系统菜单</option>
																		<option th:each="menu : ${PmenuList}" th:value="${menu.menuUuid}" th:selected="(${dataBean!=null? dataBean.menuUuid:''} == ${menu.menuUuid})"  th:text="${menu.menuName}"></option>
																	</select>
																</div>
																<div class="form-group hidden" id="menuUuidInsertDiv">
																	<label for="menuUuids">菜单id(唯一主键)<font color="red">&nbsp;&nbsp;*</font></label>
																	<input type="text" class="form-control" name="menuUuidInsert" id="menuUuidInsert" placeholder="菜单id(唯一主键)" />
																</div> 
																<div class="form-group">
																	<label for="menuName">菜单名称<font color="red">&nbsp;&nbsp;*</font></label>
																	<input type="hidden" name="menuUuid" id="menuUuid" th:value="${dataBean!=null? dataBean.menuUuid:''}" />
																	<input type="text" th:value="${dataBean!=null? dataBean.menuName:''}" name="menuName" class="form-control" id="menuName" placeholder="菜单名称" />
																</div>
																<div class="form-group">
																	<label for="menuUrl">菜单url<font color="red">&nbsp;&nbsp;*</font></label>
																	<input type="text" class="form-control" th:value="${dataBean!=null? dataBean.menuUrl:''}" name="menuUrl" id="menuUrl" placeholder="菜单url" />
																</div>
																<div class="form-group">
																	<label for="menuClasstype">菜单图标<font color="red">&nbsp;&nbsp;*</font></label>
																	<input type="text" class="form-control" th:value="${dataBean!=null? dataBean.menuClasstype:''}" name="menuClasstype" id="menuClasstype" placeholder="菜单图标" />
																</div>
																<label class="">角色</label>
																<div class="form-group">
																	<label class="checkboxs" th:each="role,roleStat : ${rList}">
																		<div class="icheckbox_minimal-blue " aria-checked="false" aria-disabled="false" style="position: relative;">
																			<input type="checkbox" th:value="${role.roleUuid}" name="roleUuids"  th:each="roleUid,roleUidStat : ${dataBean!=null && dataBean.roleUuids!=null}?${dataBean.roleUuids}:''"  th:checked="(${role.roleUuid} == ${roleUid})"   class="minimal" id="roleUuids" style="position: absolute; opacity: 0;" />
																		</div>
																		<span th:text="${role.roleName}"></span>
																	</label>
															   </div>
															   <div class="modal-footer">
																	<div class="row">
																		<div class="col-xs-6 text-center">
																			<button type="reset" class="btn btn-warning" name="cleanAll">清&nbsp;&nbsp;&nbsp;&nbsp;除</button>
																		</div>
																		<div class="col-xs-6 text-center">
																			<button type="submit" class="btn btn-primary">提&nbsp;&nbsp;&nbsp;&nbsp;交</button>
																		</div>
																	</div>
																</div>
															</form>
														</div>
													</div>
												</div>
											</div>
										</div>
										<div class="col-xs-4">
											<h3 class="box-title">菜单数据列表</h3>
										</div>
										<div class="col-xs-4"></div>
									</div>
								</div>
								<div class="box-body table-responsive">
								<table id="example2" class="table table-bordered table-striped ">
									<thead>
										<tr class="bg-green ">
											<th>菜单id</th>
											<th>菜单名称</th>
											<th>菜单url</th>
											<th>所属父级菜单</th>
											<th>是否可用</th>
											<th>操作</th>
										</tr>
									</thead>
										<tbody th:remove="all-but-first">
											<tr th:if="${menuList!=null}" th:class="${menustar.index % 2 ==0}? '' : 'bg-gray'" th:each="menu,menustar:${menuList!=null ? menuList:'' }">
												<td th:text="${menu.menuUuid}"></td>
												<td th:text="${menu.menuName}"></td>
												<td th:text="${menu.menuUrl}"></td>
												<td th:text="${menu.Pmenu.menuName}"></td>
												<td><i class="fa fa-circle text-success"></i>可用</td>
												<td>&nbsp;&nbsp;&nbsp;&nbsp;
													<a href="javascript:void(0);" name="show"  th:id="${menu.menuUuid}" class="fa fa-file  btn btn-primary">详情</a>&nbsp;&nbsp;&nbsp;&nbsp;
													<a href="javascript:void(0);" th:id="${menu.menuUuid}"  data-toggle="tooltip"  data-placement="right" data-original-title="删除后将无法恢复"  class="fa fa-trash btn btn-primary example5-3-2" >废除</a>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</div>
						</div>
					</div>
				</div>
			</section>
		</div>
		<div th:replace="common/common_h5 :: down_foot"></div>
		<div th:replace="common/common_h5 :: down_sidebar"></div>
		<div th:replace="common/common_h5 :: error_message"></div>
		<div class="control-sidebar-bg"></div>
		<div th:replace="common/common_resource :: common_js"></div>
		<script th:src="@{/admin_js/basics/menu_list.js}"></script>
</body>
</html>
